import http from '@/utils/request.js'

export const loginAPI = (params) => http.post("/login", params);
export const registerAPI = (params) => http.post("/user/register", params);
export const logoutaAPI = () => http.post("/logout")

export const homeHotSoptsAPI = () => http.get("/spot/home/hotSpots");
export const recommendArticlesAPI = () => http.get("/article/home/recommendArticles");

export const getCityListAPI = (params) => http.post("/city/getCityList", params);
export const getAllCitiesAPI = () => http.get("/city/getAllCities");
export const getCityDetailAPI = (id) => http.get(`/city/getCityDetail/${id}`)
export const updateViewCountAPI = (id) => http.put(`/city/updateViewCount/${id}`);
export const recommendCityAPI = () => http.get("/city/recommendCity");

export const getSpotListAPI = (params) => http.post("/spot/getSpotList", params);
export const updateSpotViewCountAPI = (id) => http.put(`/spot/updateViewCount/${id}`);
export const getSpotDetailAPI = (id) => http.get(`/spot/getSpotDetail/${id}`);

export const getArticleListAPI = (params) => http.post("/article/getArticleList", params)
export const hotArticleListAPI = () => http.get("/article/hotArticleList");
export const getArticleDetailAPI = (id) => http.get(`/article/getArticleDetail/${id}`);
export const updateArticleViewCountAPI = (id) => http.put(`/article/updateViewCount/${id}`);

export const getCategoryListAPI = () => http.get("/category/getCategoryList");

export const recommendGalleryAPI = (params) => http.post("/gallery/recommendGallery", params);
export const allGalleryListAPI = () => http.get("/gallery/allGalleryList");

export const sendMessageAPI = (params) => http.post("/message/sendMessage", params);
export const allMessageListAPI = () => http.get("/message/allMessageList");

export const updateUserAPI = (params) => http.put("/user/updateUser", params);
export const UploadImgAPI = (data) => http.post("/upload", data, {
    headers: {
        'Content-Type': 'multipart/form-data'
    }
})
export const userArticlesAPI = (params) => http.post("/article/userArticles", params);

export const addArticleAPI = (params) => http.post("/article/addArticle", params);
export const categoriesAPI = () => http.get("/category/categories");

export const sendCommentAPI = (params) => http.post("/comment/sendComment", params)
export const commentListAPI = (params) => http.post("/comment/getCommentList", params)
export const deleteCommentAPI = (id) => http.put(`/comment/deleteComment/${id}`)